#!/usr/bin/python
# -*- coding: UTF-8 -*-

""" 
@version: 1.0
@author: jin.li.o
@license: Apache Licence 
@contact: x.leevin@gmail.com
@software: PyCharm
@file: clazz_if.py
@time: 2018/9/25
"""

# 控住语句 分支分流 循环语句{for, while}

# 比较，逻辑，成员运算均可
# 字符串，列表，元祖，字段，字符串，==False
# 判断语句 关键字 if..elif..else

name = input("What's your name? \n")
strAge = input("How old are you? \n")

# 判断用户输入是否为数字
if strAge.isdigit():
    age = int(strAge, 10)

    # 对年龄进行判断
    if age > 18:
        print("Hello {0}，恭喜你已经成年了！".format(name))
    elif 0 < age <= 18:
        print("Hello {0}，恭喜你还未成年哦！".format(name))
    else:
        print("Hello {0}，你输入有误！".format(name))
else:
    print("Hello {0}，你输入的不是数字！".format(name))
